<template>
  <div class="print">
    <component :is="comName"></component>
  </div>
</template>

<script>
/** components */
import AmerPrintTemplateA from '@src/modules/event/print/components/AmerPrintTemplateA.vue' // 亚码芬定制打印模板A
import AmerPrintTemplateB from '@src/modules/event/print/components/AmerPrintTemplateB.vue' // 亚码芬定制打印模板B
import AmerPrintTemplateC from '@src/modules/event/print/components/AmerPrintTemplateC.vue' // 亚码芬定制打印模板C

export default {
  name: 'print',
  components:{
    AmerPrintTemplateA,
    AmerPrintTemplateB,
    AmerPrintTemplateC,
  },
  data () {
    return {
      comName:'',
      comList: ['AmerPrintTemplateA','AmerPrintTemplateB', 'AmerPrintTemplateC']
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      const { comName } = this.$route.query
      if(!this.comList.includes(comName)) return console.error('未知打印模板')

      this.comName = comName
    }
  },
}
</script>

<style scoped lang='scss'>
  .print{
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
    padding-bottom: 20px;
  }
</style>